home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DriverSupport.h
-
- Contains: Driver Support Interfaces.
-
- Version: Technology: Sustem 7.5 and 8
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __DRIVERSUPPORT__
- #define __DRIVERSUPPORT__
-
- #ifndef __CONDITIONALMACROS__
- #include <ConditionalMacros.h>
- #endif
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __KERNEL__
- #include <Kernel.h>
- #endif
- #if FOR_SYSTEM8_PREEMPTIVE
- #ifndef __TIMING__
- #include <Timing.h>
- #endif
- #endif
- #ifndef __DEVICES__
- #include <Devices.h>
- #endif
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
- #ifndef __MACHINEEXCEPTIONS__
- #include <MachineExceptions.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- #define kAAPLDeviceLogicalAddress "AAPL,address"
- typedef LogicalAddress *DeviceLogicalAddressPtr;
- #if FOR_SYSTEM7_ONLY
-
- enum {
- durationMicrosecond = -1L, /* Microseconds are negative*/
- durationMillisecond = 1L, /* Milliseconds are positive*/
- durationSecond = 1000L, /* 1000 * durationMillisecond*/
- durationMinute = 60000L, /* 60 * durationSecond,*/
- durationHour = 3600000L, /* 60 * durationMinute,*/
- durationDay = 86400000L, /* 24 * durationHour,*/
- durationNoWait = 0L, /* don't block*/
- durationForever = 0x7FFFFFFF /* no time limit*/
- };
-
- #define kCurrentAddressSpaceID ((AddressSpaceID) -1)
- #endif
-
- enum {
- k8BitAccess = 0, /* access as 8 bit*/
- k16BitAccess = 1, /* access as 16 bit*/
- k32BitAccess = 2 /* access as 32 bit*/
- };
-
- #if FOR_SYSTEM7_ONLY
- typedef UnsignedWide Nanoseconds;
- #endif
- extern void BlockCopy(const void *srcPtr, void *destPtr, Size byteCount);
-
- extern LogicalAddress PoolAllocateResident(ByteCount byteSize, Boolean clear);
-
- extern OSStatus PoolDeallocate(LogicalAddress address);
-
- extern ByteCount GetLogicalPageSize(void );
-
- extern ByteCount GetDataCacheLineSize(void );
-
- extern OSStatus FlushProcessorCache(AddressSpaceID spaceID, LogicalAddress base, ByteCount length);
-
- extern void SynchronizeIO(void );
-
- extern LogicalAddress MemAllocatePhysicallyContiguous(ByteCount byteSize, Boolean clear);
-
- extern OSStatus MemDeallocatePhysicallyContiguous(LogicalAddress address);
-
- #if FOR_SYSTEM7_ONLY
- extern AbsoluteTime UpTime(void );
-
- extern void GetTimeBaseInfo(UInt32 *minAbsoluteTimeDelta, UInt32 *theAbsoluteTimeToNanosecondNumerator, UInt32 *theAbsoluteTimeToNanosecondDenominator, UInt32 *theProcessorToAbsoluteTimeNumerator, UInt32 *theProcessorToAbsoluteTimeDenominator);
-
- extern Nanoseconds AbsoluteToNanoseconds(AbsoluteTime absoluteTime);
-
- extern Duration AbsoluteToDuration(AbsoluteTime absoluteTime);
-
- extern AbsoluteTime NanosecondsToAbsolute(Nanoseconds nanoseconds);
-
- extern AbsoluteTime DurationToAbsolute(Duration duration);
-
- extern AbsoluteTime AddAbsoluteToAbsolute(AbsoluteTime absoluteTime1, AbsoluteTime absoluteTime2);
-
- extern AbsoluteTime SubAbsoluteFromAbsolute(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime);
-
- extern AbsoluteTime AddNanosecondsToAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime);
-
- extern AbsoluteTime AddDurationToAbsolute(Duration duration, AbsoluteTime absoluteTime);
-
- extern AbsoluteTime SubNanosecondsFromAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime);
-
- extern AbsoluteTime SubDurationFromAbsolute(Duration duration, AbsoluteTime absoluteTime);
-
- extern Nanoseconds AbsoluteDeltaToNanoseconds(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime);
-
- extern Duration AbsoluteDeltaToDuration(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime);
-
- extern Nanoseconds DurationToNanoseconds(Duration theDuration);
-
- extern Duration NanosecondsToDuration(Nanoseconds theNanoseconds);
-
- #endif
- extern OSErr PBQueueInit(QHdrPtr qHeader);
-
- extern OSErr PBQueueCreate(QHdrPtr *qHeader);
-
- extern OSErr PBQueueDelete(QHdrPtr qHeader);
-
- extern void PBEnqueue(QElemPtr qElement, QHdrPtr qHeader);
-
- extern OSErr PBEnqueueLast(QElemPtr qElement, QHdrPtr qHeader);
-
- extern OSErr PBDequeue(QElemPtr qElement, QHdrPtr qHeader);
-
- extern OSErr PBDequeueFirst(QHdrPtr qHeader, QElemPtr *theFirstqElem);
-
- extern OSErr PBDequeueLast(QHdrPtr qHeader, QElemPtr *theLastqElem);
-
- extern char *CStrCopy(char *dst, const char *src);
-
- extern StringPtr PStrCopy(StringPtr dst, ConstStr255Param src);
-
- extern char *CStrNCopy(char *dst, const char *src, UInt32 max);
-
- extern StringPtr PStrNCopy(StringPtr dst, ConstStr255Param src, UInt32 max);
-
- extern char *CStrCat(char *dst, const char *src);
-
- extern StringPtr PStrCat(StringPtr dst, ConstStr255Param src);
-
- extern char *CStrNCat(char *dst, const char *src, UInt32 max);
-
- extern StringPtr PStrNCat(StringPtr dst, ConstStr255Param src, UInt32 max);
-
- extern void PStrToCStr(char *dst, ConstStr255Param src);
-
- extern void CStrToPStr(Str255 dst, const char *src);
-
- extern SInt16 CStrCmp(const char *s1, const char *s2);
-
- extern SInt16 PStrCmp(ConstStr255Param str1, ConstStr255Param str2);
-
- extern SInt16 CStrNCmp(const char *s1, const char *s2, UInt32 max);
-
- extern SInt16 PStrNCmp(ConstStr255Param str1, ConstStr255Param str2, UInt32 max);
-
- extern UInt32 CStrLen(const char *src);
-
- extern UInt32 PStrLen(ConstStr255Param src);
-
- extern OSStatus DeviceProbe(void *theSrc, void *theDest, UInt32 AccessType);
-
- extern OSStatus DelayForHardware(AbsoluteTime absoluteTime);
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __DRIVERSUPPORT__ */
-
-